<template>
	<om-formsub-outer :index="index" :checkedit="checkedit">
		<om-autoform @deleteItem="deleteUserItem" ref="autoform" :initConfigData="autoformdata" :initValue="initValue"></om-autoform>
	</om-formsub-outer>
</template>

<script>
	import {buildSubFormData, subOnLoad, changeEditor,configSelectData,hasValue} from '@/static/js/formUtil.js';
	import { ignoreHtml,ptFloat,minusF,getDateStr,errorModal} from '@/static/js/common.js';
	import urlUtil from '@/static/js/urlUtil.js'
	export default {
		provide() {
			return {
				formPage: this
			};
		},
		data() {
			return buildSubFormData({
				
			})
		},
		methods:{
			initLoad(){
				let _that = this
				
				_that.$nextTick(function(){
					
				})
			},
			oninputUnqualifiedNumber(num){
				let _that = this
				if(_that.$refs.autoform.formdata.actualSample){
					if(Number(num)>_that.$refs.autoform.formdata.actualSample){
						errorModal(_that,'提示信息','样本不合格数不能大于样本量！',()=>{
							_that.$refs.autoform.clear('title5', 'unqualifiedNumber');
						})
					}else{
						_that.$refs.autoform.formdata.unqualifiedNumberSum = num
					}
				}
			},
		},
		onShow() {
			let _that = this
			if(_that.$refs.autoform){
				
			}
		},
		onLoad(e) {
			let _that = this
			subOnLoad(_that, e, function() {
				
				if(e.configDataCacheKey){
					uni.getStorage({
						key: e.configDataCacheKey,
						success: function(res) {
							if(res.data && Object.prototype.toString.call(res.data)==='[object Array]'){
								_that.autoformdata = res.data
								Object.assign(_that.initValue, _that.formdata)
								
								
								
								_that.initLoad()
								
								}
							}
						})
					}
				})
			}
		}
</script>

<style>
</style>